const Mock = require('mockjs')


const data = Mock.mock({
  'list|100': [{
    id: '@increment',
    create_time: '@datetime',
    name: '@first @last',
  }]
})

module.exports = [
  {
    url: '/brand/list',
    type: 'get',
    response: config => {
      const { pageNum,pageSize } = config.query
      const mockList = data.list.filter(item => {
        return true
      })
      const pageList = mockList.filter((item, index) => index < pageNum * pageSize && index >= pageNum * (pageSize - 1))
      return {
        code: 20000,
        data: {
          total: data.length,
          list: pageList
        }
      }
    }
  }

]

